//
//  MutiltimediaView.h
//  ChildHoodStemp
//
//  Created by xuzuotao on 13-10-6.
//
//

#import <UIKit/UIKit.h>

typedef enum {
    CHSVoiceTypeSended = 0,
    CHSVoiceTypeReceived,
    CHSVoiceNoticeTypeReceived
} CHSVoiceType;

@class SNSPMultimedia;
@class ChildHoodMessage;


@protocol MutiltimediaViewDelegate <NSObject>
@optional
- (void)bubbleViewNeedResetFrameWithFrame:(CGRect)frame;
- (void)scrollRight;
- (void)scrollLeft;
@end

@interface MutiltimediaView : UIScrollView
{
    CHSVoiceType   _voiceType;
    BOOL           _isFromChat;
    NSString       *_fileUri;
    NSIndexPath    *_indexPath;
}
@property (nonatomic, assign) int64_t voiceMsgDBID;
@property (nonatomic, assign) int64_t voiceMsgID;//同步服务器id
@property (nonatomic, copy) NSString *fileUri;
@property (nonatomic, assign) BOOL  isFromChat;
@property (nonatomic, assign) BOOL  showProgress;
@property (nonatomic, copy) NSString *downloadUrl;
@property (nonatomic, copy) NSString *fileName;
@property (nonatomic, copy) NSString *redpacketInfo;
@property (nonatomic, copy) NSString *fileId;
@property (nonatomic, copy) NSString *chatType;
@property (nonatomic, copy) NSString *localFilePath;

@property (nonatomic, assign) CHSVoiceType voiceType;
@property (nonatomic, retain) NSIndexPath *indexPath;
@property (nonatomic, assign)BOOL isAutoPlayOrShow;//是否允许自动播放或者显示图片
@property (nonatomic, assign) NSInteger voiceLenth;
@property (nonatomic, assign) MessageSoundPlayStatus is_played;
@property (nonatomic, assign) ChildHoodMessage *childMessage;

@property (nonatomic, weak) id<MutiltimediaViewDelegate> multiDelegate;

//-(void)setMultimediaFileUri:(NSString*)fileUri type:(int32_t)type;
//-(void)setMultimediaFileName:(NSString*)fileName type:(int32_t)type;
- (void)setDownloadUrlWithFileName:(NSString *)fileName fileId:(NSString *)fileId chatType:(NSString *)chatType childMessage:(ChildHoodMessage *)message;

-(void)setImage:(UIImage*)image;

//-(NSString*)localFileName:(BOOL)md5Flag;

-(void)setImgVoiceOrigin;

-(BOOL)adjustFileExistWithPath:(NSString *)path;

//- (void)setVoiceType:(CHSVoiceType)voiceType WithVoiceLenth:(NSInteger)voiceLenth;

//-(void)showImageInfullScreen:(UIImage*)image;
//-(void)showImage2XInfullScreen:(UIImage*)image;
- (void)showImageWithMessage:(ChildHoodMessage *)message;

@end
